Skip to content

feat(bokeh): implement chernoff-basic#3042

Merged
github-actions[bot] merged 6 commits intomainfrom
implementation/chernoff-basic/bokeh
Dec 31, 2025
Merged

feat(bokeh): implement chernoff-basic#3042
github-actions[bot] merged 6 commits intomainfrom
implementation/chernoff-basic/bokeh

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: chernoff-basic - bokeh

Implements the bokeh version of chernoff-basic.

File: plots/chernoff-basic/implementations/bokeh.py

Parent Issue: #3003


🤖 impl-generate workflow

github-actions bot and others added 2 commits December 31, 2025 10:59
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Dec 31, 2025

AI Review - Attempt 1/3

Image Description

The plot displays 12 Chernoff faces arranged in a 4×3 grid representing company performance metrics across three business sectors. The title "chernoff-basic · bokeh · pyplots.ai" appears at the top center. A horizontal legend near the top shows three colored circles: blue (Tech), yellow (Retail), and brown/tan (Energy). Tech companies (top row) have wide, horizontally-stretched blue faces with smiling mouths, reflecting high revenue growth and market share. Retail companies (middle row) have more rounded yellow faces with neutral to slightly curved mouths. Energy companies (bottom row) have narrower brown faces with distinctly frowning mouths, reflecting low growth and market share. Each face has white eyes with dark pupils, eyebrows, and a simple nose. Labels below each face identify the sector and number (e.g., "Tech #1"). A subtitle at the bottom explains the feature mapping: "Face width=Revenue Growth, Face height=Profit Margin, Eye size=Satisfaction, Mouth=Market Share". The background is a light gray (#FAFAFA).

Quality Score: 88/100

Criteria Checklist

Visual Quality (35/40 pts)

  • VQ-01: Text Legibility (8/10) - Title at 32pt is readable, labels at 20pt are adequate but could be slightly larger for the 4800×2700 canvas. The feature mapping subtitle at 18pt is on the small side.
  • VQ-02: No Overlap (8/8) - No overlapping text or elements; grid layout is clean with good spacing between faces.
  • VQ-03: Element Visibility (7/8) - Faces are well-sized and clearly visible. The facial features (eyes, mouth, eyebrows) are distinct. Minor deduction as some finer details like nose could be more prominent.
  • VQ-04: Color Accessibility (5/5) - Blue, yellow, and brown colors are distinguishable and colorblind-safe (no red-green reliance).
  • VQ-05: Layout Balance (5/5) - Grid fills the canvas well with balanced margins. Legend positioned appropriately at top.
  • VQ-06: Axis Labels (0/2) - N/A for this plot type (no axes) - giving full points as axes are intentionally hidden.
  • VQ-07: Grid & Legend (2/2) - Legend is clear with colored circles and sector names. Grid is hidden as appropriate for this visualization.

Spec Compliance (23/25 pts)

  • SC-01: Plot Type (8/8) - Correct Chernoff faces implementation with facial features encoding multivariate data.
  • SC-02: Data Mapping (5/5) - Four variables correctly mapped: face width (revenue growth), face height (profit margin), eye size (satisfaction), mouth curvature (market share).
  • SC-03: Required Features (4/5) - Implements face width, height, eye size, mouth curvature, eyebrows, and nose. Missing some potential features like eye spacing mentioned in spec.
  • SC-04: Data Range (3/3) - All faces visible and within the plot area.
  • SC-05: Legend Accuracy (2/2) - Sector legend is accurate and clear.
  • SC-06: Title Format (1/2) - Uses correct format "chernoff-basic · bokeh · pyplots.ai" but uses regular dot character instead of middle dot (·) - minor issue.

Data Quality (18/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows good variation: Tech has wide smiling faces, Energy has narrow frowning faces. Could have more extreme variations to demonstrate full feature range.
  • DQ-02: Realistic Context (7/7) - Excellent business scenario using Tech/Retail/Energy sector performance metrics that are intuitive and neutral.
  • DQ-03: Appropriate Scale (4/5) - Values are normalized 0-1 as spec requires. Data generation creates believable sector differences.

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (2/3) - Uses a helper function draw_chernoff_face which violates KISS principle (spec says "no functions, no classes"). The function is reasonable for complexity but deviates from standard.
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42) for reproducibility.
  • CQ-03: Clean Imports (2/2) - All imports are used (numpy, bokeh.io, bokeh.models, bokeh.plotting).
  • CQ-04: No Deprecated API (1/1) - Uses current Bokeh API.
  • CQ-05: Output Correct (1/1) - Saves as plot.png using export_png.

Library Features (3/5 pts)

  • LF-01: Distinctive Features (3/5) - Uses Bokeh's figure, patch(), line(), and Label for drawing faces. Could leverage more Bokeh-specific features like ColumnDataSource or interactive hover tooltips to distinguish from other libraries.

Strengths

  • Excellent implementation of Chernoff faces concept with clear visual differentiation between sectors
  • Smart use of realistic business context (Tech/Retail/Energy companies with meaningful metrics)
  • Clean grid layout that maximizes canvas utilization with balanced spacing
  • Good color accessibility with distinct, colorblind-safe palette
  • Helpful feature mapping subtitle that aids interpretation
  • Proper normalization of data as specified

Weaknesses

  • Code uses a helper function which violates the KISS principle (should be inline code)
  • Could leverage more Bokeh-specific features like ColumnDataSource or hover tooltips for interactivity
  • Subtitle text at 18pt is slightly small for the 4800×2700 canvas - consider 20pt+
  • Title uses regular Unicode middle dot but renders correctly

Verdict: REJECTED

The implementation is strong overall (88/100) and effectively demonstrates Chernoff faces. The main issues are the helper function violating KISS structure and not fully utilizing Bokeh's distinctive features. With the function inlined and minor text size adjustments, this should reach the 90+ threshold.

@github-actions github-actions bot added the quality:88 Quality score: 88/100 label Dec 31, 2025
@github-actions github-actions bot added ai-rejected Quality not OK, triggers update ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels Dec 31, 2025
Attempt 1/3 - fixes based on AI review:
- Remove helper function (KISS principle) - inline all face drawing code
- Increase subtitle font size from 18pt to 22pt for better legibility
- Add ColumnDataSource and HoverTool for Bokeh-specific interactivity
- Add hover tooltips showing company metrics on face hover

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

🔧 Repair Attempt 1/3

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Dec 31, 2025

AI Review - Attempt 2/3

Image Description

The plot displays 12 Chernoff faces arranged in a 4x3 grid on a light gray background. The title "chernoff-basic · bokeh · pyplots.ai" appears at the top in black text. A legend at the top shows three colored circles representing sectors: Tech (blue), Retail (yellow), and Energy (brown/tan). The top row contains 4 Tech company faces (blue, wider faces with smiling expressions indicating higher metrics). The middle row shows 4 Retail company faces (yellow, more circular with neutral expressions). The bottom row displays 4 Energy company faces (brown/tan, narrower with frowning expressions indicating lower metrics). Each face is labeled below (e.g., "Tech #1", "Retail #1"). A subtitle at the bottom explains the feature mapping. The faces have clearly visible features: eyebrows, eyes with white sclera and dark pupils, a simple nose line, and curved mouths.

Quality Score: 91/100

Criteria Checklist

Visual Quality (36/40 pts)

  • VQ-01: Text Legibility (9/10) - Title at 32pt is excellent, labels at 20pt are readable, subtitle at 22pt is clear. Minor deduction for slightly small subtitle relative to canvas size.
  • VQ-02: No Overlap (8/8) - No overlapping text elements, all labels clearly separated from faces and each other.
  • VQ-03: Element Visibility (8/8) - Faces are well-sized for the grid, facial features (eyes, mouth, eyebrows) are clearly distinguishable.
  • VQ-04: Color Accessibility (4/5) - Blue, yellow, and brown are distinguishable for most colorblind users, though the brown/tan is somewhat muted.
  • VQ-05: Layout Balance (4/5) - Good use of canvas with faces well-distributed. Slight imbalance with more whitespace at bottom than top.
  • VQ-06: Axis Labels (2/2) - N/A for this plot type; subtitle explains feature mappings clearly.
  • VQ-07: Grid & Legend (1/2) - Legend is present and clear, but positioned quite far from faces at the very top.

Spec Compliance (23/25 pts)

  • SC-01: Plot Type (8/8) - Correctly implements Chernoff faces with facial features mapped to variables.
  • SC-02: Data Mapping (5/5) - Four variables correctly mapped: face width (revenue growth), face height (profit margin), eye size (satisfaction), mouth curve (market share).
  • SC-03: Required Features (4/5) - Has face outline, eyes with pupils, eyebrows, nose, and mouth. Grid layout implemented. Minor: could have more facial features for additional variables.
  • SC-04: Data Range (3/3) - All data properly normalized and displayed.
  • SC-05: Legend Accuracy (2/2) - Sector legend correctly identifies Tech, Retail, and Energy with matching colors.
  • SC-06: Title Format (1/2) - Uses correct format "chernoff-basic · bokeh · pyplots.ai" with middle dots.

Data Quality (19/20 pts)

  • DQ-01: Feature Coverage (7/8) - Shows clear variation between sectors: Tech faces are wider with smiles (high growth/market share), Retail faces are medium-sized with neutral expressions, Energy faces are narrower with frowns (low growth). Good variety within sectors too.
  • DQ-02: Realistic Context (7/7) - Excellent business context comparing company performance metrics across three industry sectors. Plausible metric ranges.
  • DQ-03: Appropriate Scale (5/5) - All metrics normalized to 0-1 range as spec requires, with realistic sector-specific distributions.

Code Quality (9/10 pts)

  • CQ-01: KISS Structure (2/3) - Generally follows KISS but has complex inline loop. Acceptable for this complex plot type.
  • CQ-02: Reproducibility (3/3) - Uses np.random.seed(42) for deterministic data generation.
  • CQ-03: Clean Imports (2/2) - All imports are used (numpy, bokeh.io, bokeh.models, bokeh.plotting).
  • CQ-04: No Deprecated API (1/1) - Uses current Bokeh API.
  • CQ-05: Output Correct (1/1) - Correctly saves as plot.png using export_png.

Library Features (4/5 pts)

  • LF-01: Uses distinctive library features (4/5) - Good use of ColumnDataSource for hover tooltips, HoverTool for interactivity (though not visible in PNG), Label objects for text positioning. Uses patch() for drawing ellipses which is idiomatic Bokeh.

Strengths

  • Clear visual differentiation between sectors through color and facial expression patterns
  • Excellent business context with realistic company performance metrics
  • Proper normalization of data as spec requires
  • Good use of Bokeh-specific features: ColumnDataSource, HoverTool for interactivity
  • Feature mapping subtitle explains what each facial feature represents
  • Well-organized 4x3 grid layout makes comparison easy

Weaknesses

  • Legend positioned too far from the faces (at very top of plot)
  • Faces could be slightly larger to better utilize the canvas space

Verdict: APPROVED

@github-actions github-actions bot added the quality:91 Quality score 91/100 label Dec 31, 2025
@github-actions github-actions bot added the ai-approved Quality OK, ready for merge label Dec 31, 2025
@github-actions github-actions bot merged commit ab70787 into main Dec 31, 2025
3 checks passed
@github-actions github-actions bot deleted the implementation/chernoff-basic/bokeh branch December 31, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:88 Quality score: 88/100 quality:91 Quality score 91/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants